<aside id="app-aside" class="app-aside top light">
    <div class="container">
        <!-- aside-menu -->
        <div class="aside-menu-wrapper">
            <div id="aside-top-menu-toggle" class="visible-xs-inline-block">
                <button data-toggle="class" data-target="#aside-top-menu" data-class="open" self-toggle="is-active"
                        class="hamburger hamburger--spin js-hamburger" type="button">
					<span class="hamburger-box">
						<span class="hamburger-inner"></span>
					</span>
                </button>
            </div>
            <ul class="sf-menu aside-menu aside-top-menu" id="aside-top-menu">
                <li>
                    <a href="{:url('index')}" class="menu-link">
                        <span class="menu-icon"><i class="zmdi zmdi-home zmdi-hc-lg"></i></span>
                        <span class="menu-text">会员中心</span>
                    </a>
                </li><!-- .menu-item -->
                <li>
                    <a href="javascript:void(0)" class="menu-link">
                        <span class="menu-icon"><i class="fa fa-tag"></i></span>
                        <span class="menu-text">订单管理</span>
                    </a>
                    <ul>
                        <li><a href="{:url('qqAdd')}">添加QQ</a></li>
                        <li><a href="{:url('qqList')}">QQ列表</a></li>
                        <li><a href="{:url('order')}">自助下单</a></li>
                        <li><a href="{:url('qqSJ')}">QQ升级计算</a></li>
                    </ul>
                </li><!-- .menu-item -->
                <li>
                    <a href="{:url('shequ')}" class="menu-link">
                        <span class="menu-icon"><i class="fa fa-bolt"></i></span>
                        <span class="menu-text">代刷下单</span>
                    </a>
                </li><!-- .menu-item -->
                <li>
                    <a href="javascript:void(0)" class="menu-link">
                        <span class="menu-icon"><i class="fa fa-shopping-cart"></i></span>
                        <span class="menu-text">在线商城</span>
                    </a>
                    <ul>
                        <li><a href="{:url('shop')}">自助开通VIP</a></li>
                        <li><a href="{:url('recharge')}">充值金币</a></li>
                        <li><a href="{:url('rmbList')}">收支明细</a></li>
                    </ul>
                </li><!-- .menu-item -->

                <li>
                    <a href="javascript:void(0)" class="menu-link">
                        <span class="menu-icon"><i class="fa fa-hand-o-up"></i></span>
                        <span class="menu-text">会员福利</span>
                    </a>
                    <ul>
                        <li><a href="{:url('invite')}">邀请好友</a></li>
                        <li><a href="{:url('qiandao')}">每日签到</a></li>
                    </ul>
                </li><!-- .menu-item -->

                <li>
                    <a href="javascript:void(0)" class="menu-link">
                        <span class="menu-icon"><i class="fa fa-list-ol"></i></span>
                        <span class="menu-text">排行榜</span>
                    </a>
                    <ul>
                        <li><a href="{:url('rank',['kind'=>'invite'])}">邀请人数排行榜</a></li>
                        <li><a href="{:url('rank',['kind'=>'order'])}">分站订单排行榜</a></li>
                    </ul>
                </li><!-- .menu-item -->
                <li>
                    <a href="javascript:void(0)" class="menu-link">
                        <span class="menu-icon"><i class="fa fa-suitcase"></i></span>
                        <span class="menu-text">API管理</span>
                    </a>
                    <ul>
                        <li><a href="{:url('apicontrol')}">API说明</a></li>
                        <li><a href="{:url('kami')}">代挂对接卡密</a></li>
                    </ul>
                </li><!-- .menu-item -->

                <li>
                    <a href="{:url('ktfz')}" class="menu-link">
                        <span class="menu-icon"><i class="fa fa-share-alt"></i></span>
                        <span class="menu-text">开通分站</span>
                    </a>
                </li><!-- .menu-item -->

                <li>
                    <a href="{:url('chat')}" class="menu-link">
                        <span class="menu-icon"><i class="fa fa-comments"></i></span>
                        <span class="menu-text">聊天室</span>
                    </a>
                </li><!-- .menu-item -->

                <li>
                    <a href="{:url('help')}" class="menu-link">
                        <span class="menu-icon"><i class="fa fa-hand-o-up"></i></span>
                        <span class="menu-text">帮助中心</span>
                    </a>
                </li><!-- .menu-item -->
            </ul>
        </div>
        <!-- /aside-menu -->

        <!-- aside-user -->
        <div class="aside-user">
            <ul>

                <li class="dropdown">
                    <a class="dropdown-toggle usertitle" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false">
                        <div class="avatar avatar-md avatar-circle">
                            <img class="img-responsive" src="http://q1.qlogo.cn/g?b=qq&nk={$userInfo.qq}&s=160"
                                 alt="avatar" style="position: absolute">
                            <span class="badge badge-danger"
                                  style="padding: 0 2px 0 2px;margin-left: 35px;margin-bottom: -70px;position: relative;">{$message_look}</span>
                        </div><!-- .avatar -->
                    </a>
                    <ul class="dropdown-menu animated flipInY">
                        <li>
                            <a class="text-color" onclick="showMessage();">
                                <span class="m-r-xs"><i class="fa fa-envelope"></i></span>
                                <span>我的消息</span>
                                <span class="pull-right">
                                    <span class="badge badge-danger">{$message_look}</span>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a class="text-color" href="{:url('index')}">
                                <span class="m-r-xs"><i class="fa fa-home"></i></span>
                                <span>会员中心</span>
                            </a>
                        </li>
                        <li>
                            <a class="text-color" href="{:url('profile')}">
                                <span class="m-r-xs"><i class="fa fa-user"></i></span>
                                <span>个人信息</span>
                            </a>
                        </li>
                        {if condition="$userInfo.power eq 9"}
                        <li>
                            <a class="text-color" href="{:url('index/Admin/index')}">
                                <span class="m-r-xs"><i class="fa fa-paypal"></i></span>
                                <span>管理后台</span>
                            </a>
                        </li>
                        {/if}

                        <li role="separator" class="divider"></li>
                        <li>
                            <a class="text-color" href="{:url('index/Index/logout')}"
                               onclick="return confirm('确认退出登录？');">
                                <span class="m-r-xs"><i class="fa fa-power-off"></i></span>
                                <span>退出</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown">
                    <a class="dropdown-toggle usertitle" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" id="message">
                    </a>
                    <ul class="dropdown-menu animated flipInY">
                        <li class="text-center notifi-title"><i class="fa fa-envelope"></i> 我的消息</li>
                        <li class="list-group">
                            {volist name="message_list" id="message"}
                            <!-- list item-->
                            <a class="list-group-item" role="menuitem" style="padding: 5px;" alt="{$message.title}" onclick="loadMessage({$message.id});">
                                <div class="media">
                                    <div class="media-left padding-right-5">
                                        <img class="img-circle" src="http://q1.qlogo.cn/g?b=qq&nk={$message.qq}&s=160"
                                             style="width: 40px;margin-right: 5px;max-width: 40px;">

                                    </div>
                                    <div class="media-body">
                                        <h6 class="media-heading"
                                            style="width: 200px;display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;">
                                            {$message.title}</h6>
                                        <time class="media-meta">{$message.addtime}</time>
                                        {if condition="!$message.islook"}
                                        <span class="pull-right">
                                            <span class="badge badge-danger">New</span>
                                        </span>
                                        {/if}
                                    </div>
                                </div>
                            </a>
                            {/volist}
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
        <!-- /aside-user -->
    </div>
</aside>
<div id="modal-message" class="modal fade bg-info">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title text-info">我的消息</h4>
            </div>
            <div class="modal-body">
                <div class="panel panel-info">
                    <div class="panel-heading" id="message-title">加载中，请稍后...</div>
                    <div class="panel-body text-info" style="    background: #efefef;">
                        <div id="message-message"></div>
                        <div class="text-right" id="message-user"></div>
                        <div class="text-right" id="message-addtime"></div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
<script>
    function showMessage() {
        setTimeout(function () {
            $('#message').dropdown('toggle');
        }, 10);
    }
    function loadMessage(id) {
        $.post("{:url('Ajax/message')}", {id: id}, function (json) {
            if (json.code == 0) {
                $("#message-title").text(json.message.title);
                $("#message-message").html(json.message.message);
                $("#message-user").text("From：" + json.message.user + "[UID:" + json.message.fid + "]");
                $("#message-addtime").html(json.message.addtime);
                $("#modal-message").modal("show");
            } else {
                alert("加载消息失败！");
            }
        }, 'json');
    }
    {if condition="$forceId gt 0"}
        loadMessage({$forceId});
    {/if}
</script>